package com.fh.modules.kms.entity;

import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.util.Date;

/**
 * @Author qiujunda
 * @Date 15/06/2020
 * @Description
 */
@Data
@NoArgsConstructor
@Accessors(chain = true)
@Document(indexName = "#{esAttribute.indexName}",type = "_doc")
public class SqlLog {

    @Id
    private Long id;
    @Field(type = FieldType.Keyword)
    private String dbName;
    @Field(type = FieldType.Keyword)
    private String actor;
    @Field(type = FieldType.Keyword)
    private String clusterNode;
    @Field(type = FieldType.Keyword)
    private String logType;
    @Field(type = FieldType.Keyword)
    private String loginUserInfo;
    @Field(type = FieldType.Keyword)
    private String requestParams;
    @Field(type = FieldType.Long)
    private Long requestTime;
    @Field(type = FieldType.Keyword)
    private String requestUrl;
    @Field(type = FieldType.Keyword)
    private String sessionId;
    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String sql;
    @Field(type = FieldType.Date)
    private Date requestBeginTime;
    @Field(type = FieldType.Date)
    private Date requestEndTime;
}
